#pragma once
#include <unistd.h>
#include <fcntl.h>
enum
{
    SOCKET_ERROR = 1,
    BIND_ERROR,
    LISTEN_ERROR,
    USAGE_ERROR,
    EPOLL_CREATE_ERROR,
};

void SetSockNoneBlock(int fd)
{
    int oldFl = fcntl(fd,F_GETFL);
    if(oldFl >= 0)
    {
        fcntl(fd,F_SETFL,oldFl | O_NONBLOCK);
    }
}